# current_dir=$(cd $(dirname $0);pwd)
# echo "current_dir is: $current_dir"

SCRIPT=$(readlink -f "$0")
SCRIPT_PATH=$(dirname "$SCRIPT")
echo "SCRIPT_PATH is: $SCRIPT_PATH"

build_test(){
    
    rm ${SCRIPT_PATH}/test_$1.exe
    rm ${SCRIPT_PATH}/test_$1

    echo 'compile' g++ -std=$1 ${SCRIPT_PATH}/test.cpp -o ${SCRIPT_PATH}/test_$1 -I${SCRIPT_PATH}/../
    g++ -std=$1 ${SCRIPT_PATH}/test.cpp -o ${SCRIPT_PATH}/test_$1 -I${SCRIPT_PATH}/../

    echo 'execute' ${SCRIPT_PATH}/test_$1
    ${SCRIPT_PATH}/test_$1.exe

    echo ""
}

build_test c++11
build_test c++14
build_test c++17
build_test c++2a